#include "xcontent.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

XSIPContent::XSIPContent()
{
	m_data = NULL;
	m_size = 0;
	m_copyType = SHALLOW_COPY;
}
	
XSIPContent::~XSIPContent()
{
	if (m_data && m_copyType == DEEP_COPY)
		free (m_data);
	m_data = NULL;
	m_size = 0;
}

void XSIPContent::copy(void* data, int size)
{
	m_data = data;
	m_size = size;
}

XSIPContent** XSIPContent::divide(int step, int *size)
{
	*size = 0;
	return NULL;
}

void* XSIPContent::getData()
{
	return m_data;
}

int XSIPContent::getSize()
{
	return m_size;
}

void* XSIPContent::getObject(const char* name) const
{
	if (strcmp(name, "XSIPContent") == 0)
		return const_cast<XSIPContent*>(this);
	else
		return XSIPObject::getObject(name);
}
